<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>惠农网 - 产品修改</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/my.css" />
</head>
<body>
<div class="container">
    <%@include file="common/header.jsp"%>
    <div class="row">
        <div class="col-2">
            <%@include file="common/left.jsp"%>
        </div>
        <div class="col-10">
            <div class="jumbotron">
                <h6 class="display-3" style="font-size:2.5rem;">产品修改</h6>
                <%--                <p class="lead"></p>--%>
                <hr class="my-4">
                <%--                <p>请选择您要管理的项目</p>--%>
                <form action="${pageContext.request.contextPath}/product/edit" method="post" enctype="multipart/form-data">
                    <input type="hidden" value="${ebProduct.epId}" name="epId"/>
                    <div class="form-group row">
                        <label for="Name" class="col-sm-2 col-form-label">商品名称(*)：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="Name" name="epName" value="${ebProduct.epName}">
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="Description" class="col-sm-2 col-form-label">描述：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="Description" name="epDescription" value="${ebProduct.epDescription}">
                        </div>
                    </div>

                    <div class="form-group row">
                        <%--                        <label for="Status" class="col-sm-2 col-form-label">订单状态：</label>--%>
                        <%--                        <div class="col-sm-10">--%>
                        <div class="col-auto my-1">
                            <label class="mr-sm-2" for="Status">所属分类：</label>

                            <select name="classId" class="custom-select mr-sm-2" id="Status">
                                <c:forEach items="${productCategoryList}" var="list">
                                    <c:if test="${list.epcId == list.epcParentId}">
                                        <option value="${list.epcId}">${list.epcName}</option>
                                    </c:if>
                                    <c:if test="${list.epcId!=list.epcParentId}">
                                        <option value="${list.epcId}">--${list.epcName}</option>
                                    </c:if>
                                </c:forEach>
                            </select>
                        </div>
                        <%--                        </div>--%>
                    </div>

                    <div class="form-group row">
                        <label for="Price" class="col-sm-2 col-form-label">商品价格：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="Price"  name="epPrice" value="${ebProduct.epPrice}" >
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="Stock" class="col-sm-2 col-form-label">库存：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="Stock"  name="epStock" value="${ebProduct.epStock}" >
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="exampleFormControlFile1">商品图片：</label>
                        <input type="file" name="productFileName" class="form-control-file" id="exampleFormControlFile1">
                    </div>

                    <button type="submit" class="btn btn-primary">修改</button>

                </form>
            </div>
        </div>
    </div>
    <div class="row text-center">
        <%@include file="common/footer.jsp"%>
    </div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/popper.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/bootstrap.min.js"></script>
</body>
</html>